﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}

<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m">
        <div class="select-list">
            <ul>
                <li>
                    复制&nbsp;<input id="startDate" col="Date" type="text" />
                </li>
                <li>
                    日程到&nbsp;<input id="endDate" col="EndDate" type="text" />
                </li>
            </ul>
        </div>
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    $(function () {
        $('#form').validate({
            rules: {
                startDate: { required: true },
                endDate: { required: true },
            }
        });

        laydate.render({ elem: '#startDate', value: new Date() });

        laydate.render({ elem: '#endDate', value: new Date() });
    });

    function saveForm(index) {
        if ($('#form').validate().form()) {
            var postData = $('#form').getWebControls({ Id: id });
            ys.ajax({
                url: '@Url.Content("~/ScheduleManage/ScheduleUser/CopyFormJson")',
                type: 'post',
                data: postData,
                success: function (obj) {
                    if (obj.Tag == 1) {
                        ys.msgSuccess(obj.Message);
                        parent.searchGrid();
                        parent.layer.close(index);
                    }
                    else {
                        ys.msgError(obj.Message);
                    }
                }
            });
        }
    }
</script>

